Hệ thống hiệu sách thương mại điện tử

1 <?php
2 include
"dbconnect.php";
3
4 if
(isset($_POST['submit']))
5 {
6   
if($_POST['submit']=="login")
7   {
8         $username=$_POST[
'login_username'];
9         $password=$_POST[
'login_password'];
10         $query =
"SELECT * from users where UserName ='$username' AND Password='$password'";
11         $result = mysqli_query($con,$query)or die(mysql_error());
12         
if(mysqli_num_rows($result) > 0)
13         {
14              $row = mysqli_fetch_assoc($result);
15              $_SESSION[
'user']=$row['UserName'];
16              header(
"Location: index.php?login=" . "Successfully Logged In");
17         }
18         
else
19           echo
"Incorrect username or password";
20    }
21 }
22
23 ?>


Gõ tìm kiếm nhanh...